package com.czl.module_storehouse.mvp.presenter;

import com.czl.module_base.bean.ListBean;
import com.czl.module_base.http.HttpResponse;
import com.czl.module_base.mvp.presenter.BasePresenter;
import com.czl.module_base.mvp.view.SimpleView;
import com.czl.module_base.observer.AbsHandleSubscriber;
import com.czl.module_storehouse.bean.StoreHouseBean;
import com.czl.module_storehouse.mvp.model.StorehouseLocationModel;
import com.czl.module_storehouse.mvp.model.StorehouseModel;

/**
 * @author by xubin,
 * @date on 2022/3/2.
 * PS: Not easy to write code, please indicate.
 */
public class StorehousePresenter extends BasePresenter<StorehouseModel, SimpleView> {
    public static final String TAG_STOREHOUSE_LIST = "storehouse_List";

    public void getManageCompanystorehouseList(String applyCompanyId) {
        doSubscribe2(mModel.getManageCompanystorehouseList(applyCompanyId), new AbsHandleSubscriber<HttpResponse<ListBean<StoreHouseBean>>>() {
            @Override
            public void onSuccess(HttpResponse<ListBean<StoreHouseBean>> httpResponse) {
                httpResponse.setRequestTag(TAG_STOREHOUSE_LIST);
                mView.showHttpResponse(httpResponse);
            }
        });
    }

    public void getStorehouseByUserId() {
        doSubscribe2(mModel.getStorehouseByUserId(), new AbsHandleSubscriber<HttpResponse<ListBean<StoreHouseBean>>>() {
            @Override
            public void onSuccess(HttpResponse<ListBean<StoreHouseBean>> httpResponse) {
                httpResponse.setRequestTag(TAG_STOREHOUSE_LIST);
                mView.showHttpResponse(httpResponse);
            }
        });
    }
}
